﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Data;
using Gem_Tools_Utility;

namespace Gem_Tools_Entity.Gem_Tools
{
    public class CAppointments:ICloneable
    {
        private int m_intAuto_ID;
        private int m_intPriority;
        private int m_intParent_ID;
        private int m_intProject_ID;
        private int m_intType;
        private DateTime m_dtmStart_Date;
        private DateTime m_dtmEnd_Date;
        private bool m_blnAll_Day;
        private string m_strSubject;
        private string m_strLocation;
        private string m_strDescription;
        private int m_intStatus;
        private int m_intLabel;
        private int m_intResource_ID;
        private string m_strResource_IDS;
        private string m_strReminder_Info;
        private string m_strRecurrence_Info;
        private int m_intPercent_Complete;
        private DateTime m_dtmActual_Start_Date;
        private DateTime m_dtmActual_End_Date;
        private string m_strCustomField1;
        private DateTime m_dtmCreated;
        private string m_strCreated_By;
        private int m_intDeleted;
        private DateTime m_dtmLast_Updated;
        private string m_strLast_Updated_By;
        private string m_strURL;
        private Boolean m_blis_Feedback;

        public CAppointments()
        {
            ResetData();
        }

        public void ResetData()
        {
            m_intAuto_ID = CConst.INT_VALUE_NULL;
            m_intPriority = CConst.INT_VALUE_NULL;
            m_intParent_ID = CConst.INT_VALUE_NULL;
            m_intProject_ID = CConst.INT_VALUE_NULL;
            m_intType = CConst.INT_VALUE_NULL;
            m_dtmStart_Date = CConst.DTM_VALUE_NULL;
            m_dtmEnd_Date = CConst.DTM_VALUE_NULL;
            m_blnAll_Day = CConst.BL_VALUE_NULL;
            m_strSubject = CConst.STR_VALUE_NULL;
            m_strLocation = CConst.STR_VALUE_NULL;
            m_strDescription = CConst.STR_VALUE_NULL;
            m_intStatus = CConst.INT_VALUE_NULL;
            m_intLabel = CConst.INT_VALUE_NULL;
            m_intResource_ID = CConst.INT_VALUE_NULL;
            m_strResource_IDS = CConst.STR_VALUE_NULL;
            m_strReminder_Info = CConst.STR_VALUE_NULL;
            m_strRecurrence_Info = CConst.STR_VALUE_NULL;
            m_intPercent_Complete = CConst.INT_VALUE_NULL;
            m_dtmActual_Start_Date = CConst.DTM_VALUE_NULL;
            m_dtmActual_End_Date = CConst.DTM_VALUE_NULL;
            m_strCustomField1 = CConst.STR_VALUE_NULL;
            m_dtmCreated = CConst.DTM_VALUE_NULL;
            m_strCreated_By = CConst.STR_VALUE_NULL;
            m_intDeleted = CConst.INT_VALUE_NULL;
            m_dtmLast_Updated = CConst.DTM_VALUE_NULL;
            m_strLast_Updated_By = CConst.STR_VALUE_NULL;
            m_strURL = CConst.STR_VALUE_NULL;
            m_blis_Feedback = CConst.BL_VALUE_NULL;
        }


        public int Auto_ID
        {
            get
            {
                return m_intAuto_ID;
            }
            set
            {
                m_intAuto_ID = value;
            }
        }


        public int Priority
        {
            get
            {
                return m_intPriority;
            }
            set
            {
                m_intPriority = value;
            }
        }


        public int Parent_ID
        {
            get
            {
                return m_intParent_ID;
            }
            set
            {
                m_intParent_ID = value;
            }
        }


        public int Project_ID
        {
            get
            {
                return m_intProject_ID;
            }
            set
            {
                m_intProject_ID = value;
            }
        }


        public int Type
        {
            get
            {
                return m_intType;
            }
            set
            {
                m_intType = value;
            }
        }


        public DateTime Start_Date
        {
            get
            {
                return m_dtmStart_Date;
            }
            set
            {
                m_dtmStart_Date = value;
            }
        }


        public DateTime End_Date
        {
            get
            {
                return m_dtmEnd_Date;
            }
            set
            {
                m_dtmEnd_Date = value;
            }
        }


        public bool All_Day
        {
            get
            {
                return m_blnAll_Day;
            }
            set
            {
                m_blnAll_Day = value;
            }
        }


        public string Subject
        {
            get
            {
                return m_strSubject;
            }
            set
            {
                m_strSubject = value.Trim();
            }
        }


        public string Location
        {
            get
            {
                return m_strLocation;
            }
            set
            {
                m_strLocation = value.Trim();
            }
        }


        public string Description
        {
            get
            {
                return m_strDescription;
            }
            set
            {
                m_strDescription = value.Trim();
            }
        }


        public int Status
        {
            get
            {
                return m_intStatus;
            }
            set
            {
                m_intStatus = value;
            }
        }


        public int Label
        {
            get
            {
                return m_intLabel;
            }
            set
            {
                m_intLabel = value;
            }
        }


        public int Resource_ID
        {
            get
            {
                return m_intResource_ID;
            }
            set
            {
                m_intResource_ID = value;
            }
        }


        public string Resource_IDS
        {
            get
            {
                return m_strResource_IDS;
            }
            set
            {
                m_strResource_IDS = value.Trim();
            }
        }


        public string Reminder_Info
        {
            get
            {
                return m_strReminder_Info;
            }
            set
            {
                m_strReminder_Info = value.Trim();
            }
        }


        public string Recurrence_Info
        {
            get
            {
                return m_strRecurrence_Info;
            }
            set
            {
                m_strRecurrence_Info = value;
            }
        }


        public int Percent_Complete
        {
            get
            {
                return m_intPercent_Complete;
            }
            set
            {
                m_intPercent_Complete = value;
            }
        }


        public DateTime Actual_Start_Date
        {
            get
            {
                return m_dtmActual_Start_Date;
            }
            set
            {
                m_dtmActual_Start_Date = value;
            }
        }


        public DateTime Actual_End_Date
        {
            get
            {
                return m_dtmActual_End_Date;
            }
            set
            {
                m_dtmActual_End_Date = value;
            }
        }


        public string CustomField1
        {
            get
            {
                return m_strCustomField1;
            }
            set
            {
                m_strCustomField1 = value.Trim();
            }
        }


        public DateTime Created
        {
            get
            {
                return m_dtmCreated;
            }
            set
            {
                m_dtmCreated = value;
            }
        }


        public string Created_By
        {
            get
            {
                return m_strCreated_By;
            }
            set
            {
                m_strCreated_By = value.Trim();
            }
        }


        public int Deleted
        {
            get
            {
                return m_intDeleted;
            }
            set
            {
                m_intDeleted = value;
            }
        }


        public DateTime Last_Updated
        {
            get
            {
                return m_dtmLast_Updated;
            }
            set
            {
                m_dtmLast_Updated = value;
            }
        }


        public string Last_Updated_By
        {
            get
            {
                return m_strLast_Updated_By;
            }
            set
            {
                m_strLast_Updated_By = value.Trim();
            }
        }

        public string Actual_Start_Date_str
        {
            get
            {
                string v_str = "";
                if (m_dtmActual_Start_Date != CConst.DTM_VALUE_NULL)
                    v_str = m_dtmActual_Start_Date.ToString("dd-MMM-yyyy HH:mm");
                return v_str;
            }
        }

        public string Actual_End_Date_str
        {
            get
            {
                string v_str = "";
                if (m_dtmActual_End_Date != CConst.DTM_VALUE_NULL)
                    return m_dtmActual_End_Date.ToString("dd-MMM-yyyy HH:mm");
                return v_str;
            }
        }

        public string Start_Date_str
        {
            get
            {
                string v_str = "";
                if (m_dtmStart_Date != CConst.DTM_VALUE_NULL)
                    v_str = m_dtmStart_Date.ToString("dd-MMM-yyyy HH:mm");
                return v_str;
            }
        }

        public string End_Date_str
        {
            get
            {
                string v_str = "";
                if (m_dtmEnd_Date != CConst.DTM_VALUE_NULL)
                    return m_dtmEnd_Date.ToString("dd-MMM-yyyy HH:mm");
                return v_str;
            }
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        public string URL
        {
            get
            {
                return m_strURL;
            }
            set
            {
                m_strURL = value.Trim();
            }
        }

        public Boolean is_Feedback
        {
            get
            {
                return m_blis_Feedback;
            }
            set
            {
                m_blis_Feedback = value;
            }
        }

        public string Status_str
        {
            get
            {
                string v_strResult = "";
                switch (Status)
                {
                    case 0: v_strResult = "None"; break;
                    case 1: v_strResult = "WIP"; break;
                    case 2: v_strResult = "Done"; break;
                    case 3: v_strResult = "To Art"; break;
                    case 4: v_strResult = "To Tech"; break;
                }

                return v_strResult;
            }
        }
    }
}
